package georah.carto.geometries
{

	import georah.carto.Extent;
	
	/**
	 * 
	 * @author yuanm
	 */
	public class OGCGeometry
	{
		private static var _NULL:NullOGCGeometry=null;

		public static function get NULL():OGCGeometry
		{
			if (!_NULL)
			{
				_NULL=new NullOGCGeometry();
			}
			return _NULL;
		}

		private var _srid:int=4326;

		public final function get SRID():int
		{
			return _srid;
		}

		public final function set SRID(value:int):void
		{
			_srid=value;
		}

		virtual public function get asText():String
		{
			throw new ReferenceError("virtual function CANNOT be invoked");
		}

		virtual public function get envelope():Extent
		{
			throw new ReferenceError("virtual function CANNOT be invoked");
		}

	}
}

import georah.carto.geometries.OGCGeometry;
import georah.carto.Extent;

class NullOGCGeometry extends OGCGeometry
{
	override public function get asText():String
	{
		return "GEOMETRY EMPTY";
	}

	override public function get envelope():Extent
	{
		return new Extent();
	}
}
